package cn.worldyao.homework.entity;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author yaozi
 * @since 2020-05-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WorkKe extends Model<WorkKe> {

    private static final long serialVersionUID = 1L;

    public WorkKe() {
        this.createTime = LocalDateTime.now();
    }

    /**
     * 作业ID
     */
    @TableId("ID")
    private Integer id;

    /**
     * 对应的课程ID
     */
    @TableField("KE_ID")
    private Integer keId;

    /**
     * 对应的课程名称
     */
    @TableField(exist = false)
    private String keName;

    /**
     * 作业名称
     */
    @TableField("WORK_NAME")
    private String workName;

    /**
     * 作业提交开始时间
     */
    @TableField("SUB_START")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime subStart;

    /**
     * 作业提交截止时间
     */
    @TableField("SUB_END")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime subEnd;

    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**
     * 作业描述
     */
    @TableField("WORK_DESC")
    private String workDesc;

    /**
     * 作业描述
     */
    @TableField("PUB_STA")
    private String pubSta;



    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
